Support for building with sanitizers #149
Merged
+195
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a generic CMake file that contains logic to enable common sanitizers for all targets. Since building with any specific sanitizer could require other external environmental setup (certain compiler, compiler version, instrumented standard library, etc.), use of these sanitizers is expected to work only when a compatible environment is set up by an experienced developer who knows what they are doing.
CMake options are added from within the generic CMake file.
Unfortunately, there seems to be an issue with Catch2 and Windows sanitizer support, as tracked here catchorg/Catch2#898 so we can't enable that in CI, but it does compile and run successfully for the individual targets like the library and
dump-pe
executable.